<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="counter">0</div>
    <button id="btn">Click me</button>
    <script>
        document.getElementById("btn").addEventListener("click", ()=>{
            let num = parseInt(document.getElementById("counter").innerHTML)
            document.getElementById("counter").innerHTML = num + 1;
        })
    </script>
</body>
</html>